package com.hackintosh.state.student;

/**
 * @description：
 * @author：twislyn
 * @date：Created in 2021/05/23
 * @modified By：
 * @version: 1.0
 */
public class LowState extends AbstractState {

    public LowState(ScoreContext scoreContext) {
        this.scoreContext = scoreContext;
        this.stateName = "不及格";
        this.score = 0;
    }

    public LowState(AbstractState state) {
        this.stateName = "不及格";
        this.scoreContext = state.scoreContext;
        this.score = state.score;
    }

    @Override
    public void checkState() {
        if (this.score > 90) {
            this.scoreContext.setState(new HighState(this));
        } else if (this.score >= 60) {
            this.scoreContext.setState(new MiddleState(this));
        }
    }
}
